package com.week1.day03;

import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第1个人成绩");
        double first = scanner.nextDouble();
        double sum = first;
        double average;
        double max = first;
        double min = first;
        for (int i = 2; i <= 5; i++) {
            System.out.println("输入第" + i + "人成绩");
            double grade = scanner.nextDouble();
            sum += grade;
            if (grade > max) {
                max = grade;
            }
            if (grade < min) {
                min = grade;
            }
        }
        average = sum / 5;
        System.out.println("平均分：" + average + "，最高分：" + max + ",最低分：" + min);
    }
}
